<#assign path=request.contextPath>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <link rel="stylesheet" href="${path}/bootstrap-3.3.7/css/bootstrap.css">
    <script type="text/javascript" src="${path}/bootstrap-3.3.7/js/jquery.js"></script>
    <script type="text/javascript" src="${path}/bootstrap-3.3.7/js/bootstrap.js"></script>
    <base href="${path}/">
</head>
<body>
    hello
    <div class="container">
        <input class="btn btn-xs btn-danger" onclick="dels()" value="批量删除">
        <table  style="text-align: center" class="table table-hover table-bordered">
            <tr>
                <td><input type="checkbox" onclick="qx()">全选</td>
                <td>姓名</td>
                <td>年龄</td>
                <td>角色</td>
                <td>操作</td>

            </tr>
		<#list list as s>
			<tr>
                <td><input type="checkbox" class="xz" value="${s.id}" name="ids"></td>
                <td>${s.name!}</td>
                <td>${s.age!}</td>
                <td>${s.jue!}</td>

                <td>
                    <a href="${path}/del?id=${s.id}" class="btn btn-danger btn-xs">删除</a>
                </td>
            </tr>
        </#list>
            <td colspan="10" style="text-align: center">
                <input type="button" value="首页"  onclick="jumps('${page.navigateFirstPage}')">
                <input type="button" value="上一页"  onclick="jumps('${page.prePage}')">
                <input type="button" value="下一页"  onclick="jumps('${page.nextPage}')">
                <input type="button" value="末页"  onclick="jumps('${page.navigateLastPage}')">
                当前第${page.pageNum }页,一共${page.total }条数据,一共${page.pages }页
            </td>
        </table>
    </div>
</body>
<script type="text/javascript">
    function dels() {
       var ids = "";
       $("[name='ids']:checked").each(function () {
           ids+=","+$(this).val();
       })
        ids=ids.substring(1);
       location="${path}/dels?ids="+ids;
    }
    function jumps(page){
       location="${path}/list?pageNum="+page;
    }
    function qx() {
        $(".xz").each(function () {
            $(this).prop("checked",true);
        })
    }
</script>
</html>